package com.controller;

import com.dto.RequestDto;
import com.dto.ResultDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
public class SimpleController {

	private static Logger LOGGER = LoggerFactory.getLogger(SimpleController.class);

    @GetMapping("/v1/testhello")
    public ResultDTO testhello(String helloparam) {
        LOGGER.info("testhello:{}", helloparam);

        return ResultDTO.success("hello");
    }

	@PostMapping("/v1/testbody")
	public ResultDTO testbody(@RequestBody RequestDto body) {
		LOGGER.info("testbody:{}", body.getParam());
		return ResultDTO.success("get body");
	}


}
